<template>
  <div>
    <trade_fund_fh ref="trade_fund_fh" :parent="this"></trade_fund_fh>
    <div style="text-align:center">
      <el-button type="success" @click="submitForm('form')" size="mini">提交</el-button>
      <el-button type="info" @click="resetForm('form')" size="mini">重置</el-button>
    </div>
  </div>
</template>
<script>
  import * as kk from '@/utils/k-utils'
  import trade_fund_fh from '@/views/page/M8/public/trade_fund_fh'
  export default {
    data() {
      return{

      }
    },
    methods: {
      //提交交易
      submitForm(formName) {
        let params=this.$refs.trade_fund_fh.getFormParams("form");
        if(!params){
          this.$message.error("请输入必填项！！！");
        }else{
          params.t8_sys_adtype_id = '19';//交易品种：基金交易
          params.valuedate = params.tradedate;//结算日期
          params.cuy = "CNY";//币种
          if (params.direction == 1) {
              params.dealtype = "24";//基金现金分红
          } else {
              params.dealtype = "25";//基金红利再投
          }
          kk.k_load_url("fund","/fund/fund_add_trade_info.json",params).then(rep=>{
            kk.tradeSubmitFnc(rep,this.resetForm,params);
          });
        }
      },
      //重置表单
      resetForm(params) {
        this.$refs.trade_fund_fh.resetForm("form");
      }
    },
    components:{
      trade_fund_fh
    }
  }
</script>

<style scoped>
</style>
